package designpatterns.adapter.adaclass.code;

public class Phone {
    public void charge(IVoltage5V voltage5V) {
        Integer outPut5V = voltage5V.outPut5V();
        if(outPut5V != 5) {
            System.err.println("充电失败：电压："+outPut5V+"不匹配手机电压。");
        }
        System.out.println("正在充电：电压："+outPut5V);
    }
}
